Conversation
그룹 사용자 쿼리를 리팩토링하여 참석 사용자와 현재 사용자를 효율적으로 검색합니다. 이를 통해 현재 사용자가 명시적으로 참석으로 표시되지 않더라도 그룹 사용자 목록에 항상 포함되므로, 관련 정보를 표시하여 사용자 경험을 개선합니다.
|
Caution Review failedThe pull request is closed. Walkthrough모임 상세 조회 시 비호스트 사용자에 대해 저장소 메서드를 변경했습니다. 기존 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR modifies the group detail retrieval logic to ensure the current user's information is always visible, even when they are not explicitly marked as attending. The change refactors the group user query to fetch both attending users and the current user efficiently, improving the user experience by displaying relevant information consistently.
Key Changes:
- Added a new repository method to fetch attending users plus the current user
- Updated the service layer to use this new query method for non-host users
- Added test case for a second member's participation
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| GroupUserV2Repository.java | Added findAttendPlusMeByGroupId method to retrieve attending users plus the current user |
| GroupV2Service.java | Updated group detail retrieval to use the new repository method for non-host users |
| v2-group-attend-approval-required.http | Added test case for member2 participation and updated authorization token in test case 7 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| and (gu.status = team.wego.wegobackend.group.v2.domain.entity.GroupUserV2Status.ATTEND | ||
| or u.id = :userId) |
There was a problem hiding this comment.
The query may return duplicate results if a user has ATTEND status AND matches the userId condition. Consider adding DISTINCT to the query or handling duplicates in the service layer.
| List<GroupUserV2> findAttendPlusMeByGroupId(@Param("groupId") Long groupId, | ||
| @Param("userId") Long userId); |
There was a problem hiding this comment.
The method name findAttendPlusMeByGroupId doesn't clearly indicate that it may return users with non-ATTEND status. Consider renaming to findAttendingUsersAndCurrentUser or findAttendingUsersIncludingUser for better clarity.
| List<GroupUserV2> findAttendPlusMeByGroupId(@Param("groupId") Long groupId, | |
| @Param("userId") Long userId); | |
| List<GroupUserV2> findAttendingUsersAndCurrentUser(@Param("groupId") Long groupId, | |
| @Param("userId") Long userId); | |
| @Deprecated | |
| default List<GroupUserV2> findAttendPlusMeByGroupId(@Param("groupId") Long groupId, | |
| @Param("userId") Long userId) { | |
| return findAttendingUsersAndCurrentUser(groupId, userId); | |
| } |
| ### 7. (선택) 모임 상세 조회 - MEMBER1 토큰으로 내 상태 확인 | ||
| GET http://localhost:8080/api/v2/groups/{{groupId_approvalTest}} | ||
| Authorization: Bearer {{member1AccessToken}} | ||
| Authorization: Bearer {{host2AccessToken}} |
There was a problem hiding this comment.
The test description says 'MEMBER1 토큰으로 내 상태 확인' (check my status with MEMBER1 token) but uses host2AccessToken instead. Update the comment to match the actual token being used or revert to member1AccessToken if the comment is correct.
| Authorization: Bearer {{host2AccessToken}} | |
| Authorization: Bearer {{member1AccessToken}} |
📝 Pull Request
📌 PR 종류
해당하는 항목에 체크해주세요.
✨ 변경 내용
그룹 사용자 쿼리를 리팩토링하여 참석 사용자와 현재 사용자를 효율적으로 검색합니다.
이를 통해 현재 사용자가 명시적으로 참석으로 표시되지 않더라도 그룹 사용자 목록에 항상 포함되므로, 관련 정보를 표시하여 사용자 경험을 개선합니다.
🔍 관련 이슈
🧪 테스트
변경된 기능에 대한 테스트 범위 또는 테스트 결과를 작성해주세요.
🚨 확인해야 할 사항 (Checklist)
PR을 제출하기 전에 아래 항목들을 확인해주세요.
🙋 기타 참고 사항
리뷰어가 참고하면 좋을 만한 추가 설명이 있다면 적어주세요.
Summary by CodeRabbit
릴리스 노트
새로운 기능
테스트
✏️ Tip: You can customize this high-level summary in your review settings.